package com.training.java.core.exception;

public class TransferService {
	
	double checkingAccountBalance = 10000;
	double savingsAccountBalance = 10000;
	
	public void transfer(double howMuch) throws InsufficientBalanceException
	{
		if (howMuch > checkingAccountBalance)
		{
			throw new InsufficientBalanceException("Sorry not enough money in your checking account");
		}
		
		checkingAccountBalance -= howMuch;
		savingsAccountBalance +=howMuch;
		
	}

	public double getCheckingAccountBalance() {
		return checkingAccountBalance;
	}

	public double getSavingsAccountBalance() {
		return savingsAccountBalance;
	}

}
